﻿using System;

namespace ZQNB.Common.Ioc
{
    public static class CoreServiceProvider
    {
        public static IServiceLocator Current { get; set; }

        public static T LocateService<T>()
        {
            if (Current == null)
            {
                throw new Exception("CurrentProvider should be inited first！");
            }
            var service = Current.GetInstance<T>();
            return service;
        }
    }
}